<?php 
$user=$session->read('User');
$companyid=$session->read("companyid");
?>
<div class="right_side_operate_area">
<div class="right_side_title left">
		<h2>
		<?php 
		$colleagename=$session->read("companyname");
		echo $html->link($colleagename,"/companys/showinfosummary/".$companyid);
		?>
		</h2>
		<div class="clear"></div>
	</div>		
    <div class="right item_add_btn">
    <?php     	
    	$str_title=__("Add",true);
		if($id){
			$str_title=__("Edit",true);
		}
		echo $html->link(__("Cancel",true).$str_title,"/companys/demand/");
    ?>
    </div>
    <div class="clear"></div>
</div>
<div class="right_side_scollbar">
    <div class="detail_info_panel">    
    	<?php echo $form -> create('companys', array('action' => 'editdemand','type'=> 'post','onsubmit'=>'return  checkedsave()') ); ?>
		<div class="details_item_line">
			      <div class="details_item">
				      <div class="form_left_title left"><font style="color:red">*</font>标题：</div>
				      <div class="form_right_e_input left"><?php echo $form->text('CompDemand.title');?></div>
				       <div id='titlemessage' style='display:none;' class="error_message">请填写标题</div>
			      </div>
			</div>
			
			<div class="details_item_line">
			      <div class="details_item">
				      <div class="form_left_title left">发布人：</div>
				      <div class="form_right_e_input left"><?php echo $form->text('CompDemand.publisher');?></div>				    
			      </div>
		  </div>			      
			<div class="details_item_line">
			        <div class="details_item">
				      <div class="form_left_title left">有效期：</div>
				      <div class="form_right_e_input left">
				      <?php echo $form->text('CompDemand.validity',array("placeholder"=>"","onkeydown"=>"checkpricekeyup(this,event)"));?>天</div>			     				 		    
			      </div>
			</div>
			
			<div class="details_item_line">
			      <div class="details_item">
				      <div class="form_left_title left"><font style="color:red">*</font>需求类型：</div>
				      <div class="form_right_input left">
				      <?php echo $form->select('CompDemand.require_type',$type, null,null,null);?></div>				      
			          <div id='typemessage' style='display:none;' class="error_message">请选择类型</div>
			      </div>
			</div>
			      
			<div class="details_item_line">
			      <div class="details_item">
				      <div class="form_left_title left">需求描述：</div>
				      <div class="form_right_e_input left"><?php echo $form->textarea('CompDemand.need');?></div>
			      </div>
			</div>
			
			<div class="details_item_line">
				<div class="details_item">
						<div class="form_left_title left"></div>
				        <div class="form_add_submit left">
				        	 <?php echo $form->submit(__('Save',true), array("id"=>"adduser","name"=>"submit","class"=>"buttom","div"=>false));  ?>
				        	<?php echo $form->hidden('CompDemand.id')?>
				        	<?php echo $form->hidden('CompDemand.cid',array("value"=>$companyid)) ;?>
				        </div>
				</div>
		 </div>
    </form>
    </div>
</div>


<script>
$("#CompDemandRequireType option:first").html('请选择类型');
 function checkedsave(){
      		
	 if($("#CompDemandTitle").val().trim() == ''){
			$("#titlemessage").css('display','block');
			return false;
	  }else{
		 	 $("#titlemessage").css('display','none');
		  }
		  			  	
		  if($("#CompDemandRequireType").val().trim() == ''){
			$("#typemessage").css('display','block');
			return false;
	     }else{
		 	 $("#typemessage").css('display','none');
		 }	  		  	   
}
</script>
